<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    
<title>mushpup acceptance test</title>

<!-- Stylesheets -->
<link rel="stylesheet" href="../css/mushpup.css" type="text/css" media="screen" />

<!-- External Script -->
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.0");
</script>

<script type="text/javascript" src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
    
<!-- External Script -->
<script src="../js/external/paj/sha1.js"></script>
<script src="../js/external/parseUri.js"></script>
<script src="../js/external/jquery_plugins/jquery.corners.min.js"></script>
<script src="../js/mushpup/mushpup.js"></script>
   

<!-- Unit Tests -->
<script type="text/javascript">
$(document).ready(function(){
    
    var Mushpup = new MushpupBase('mushpup_container');
    
    /* Tests */
    module('get hash');
    test('intro', function() {
        ok( 1, 'autocompleting form to get hash' );
    });
    
    // hash test
    $('#locus').val('test');
    $('#pocus').val('test');
    $('#get_password_bx').click();
    test('hash', function() {
        var expect = 'Uau5Y2B43vv4iNhFenx2tFyP';
        var hash = $('#mp_ruler_hsh').html().replace(/(<([^>]+)>)/ig,"");
        equals( expect, hash, 'autocompleting form to get hash' );
    });
    
    // tab test
    $('#mp_tab_form').children('a').trigger('click');
    test('tab', function() {
        equals( $('#mp_view_safe').css('display'), 'none', 'safe tab should be hidden');
        $('#mp_tab_safe').children('a').click();
        equals( $('#mp_view_safe').css('display'), 'block', 'safe tab should be visible');
        $('#mp_tab_form').children('a').click();
        equals( $('#mp_view_safe').css('display'), 'none', 'safe tab should be hidden');
        equals( $('#mp_ruler_hsh').css('display'), 'block', 'hash block should be visible');
        $('#mp_tab_wiki').children('a').click();    // end on wiki link
    });

});
</script>

<!-- NOTE: this should be added to an external css that is linked dynamically -->
<style>
.pass { color:green; }
.fail { color:red; }
#tests, #testresult { font-size:12px; font-family:monospace; }
</style>
  
</head>
<body>
 <h1>Mushpup Acceptance Test</h1>

 <div id="mushpup_container"></div>
 <div id="main"></div>
 <ol id="tests"></ol>
 
</body>
</html>
